package user

import (
	"github.com/gin-gonic/gin"
	UserController "go-server/controller/user"
)

//CREATE TABLE `sys_user` (
//  `user_id` bigint(20) NOT NULL AUTO_INCREMENT,
//  `username` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
//  `password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '密码',
//  `salt` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '盐',
//  `email` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '邮箱',
//  `mobile` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '手机号',
//  `status` tinyint(4) DEFAULT NULL COMMENT '状态  0：禁用   1：正常',
//  `create_user_id` bigint(20) DEFAULT NULL COMMENT '创建者ID',
//  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
//  PRIMARY KEY (`user_id`) USING BTREE,
//  UNIQUE KEY `username` (`username`) USING BTREE
//) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8 COMMENT='系统用户';

func User(r *gin.Engine) {
	user := r.Group("/user")
	{
		user.POST("/login", UserController.Login)
		user.GET("/list", UserController.List)
		user.GET("/info/:id", UserController.Info)
		user.POST("/save", UserController.Save)
		user.PUT("/update", UserController.Update)
		user.DELETE("/delete/:id", UserController.Delete)
	}
}
